package com.eastfair.projectcore.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.eastfair.core.base.entity.Entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.eastfair.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;
import com.eastfair.annotation.model.EchoVO;
import com.eastfair.projectcore.enumeration.FormFieldFieldGroupEnum;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 
 * </p>
 *
 * @author zjn
 * @since 2021-12-13
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("c_form_field")
@ApiModel(value = "FormField", description = "")
@AllArgsConstructor
public class FormField extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    @TableField(value = "project_id")
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 展会id
     */
    @ApiModelProperty(value = "展会id")
    @TableField(value = "exhibition_id")
    @Excel(name = "展会id")
    private Long exhibitionId;

    /**
     * 使用主体
     */
    @ApiModelProperty(value = "使用主体")
    @Size(max = 32, message = "使用主体长度不能超过32")
    @TableField(value = "subject_type", condition = LIKE)
    @Excel(name = "使用主体")
    private String subjectType;

    /**
     * 语言环境
     */
    @ApiModelProperty(value = "语言环境")
    @Size(max = 16, message = "语言环境长度不能超过16")
    @TableField(value = "language_type", condition = LIKE)
    @Excel(name = "语言环境")
    private String languageType;

    /**
     * 字段名称
     */
    @ApiModelProperty(value = "字段名称")
    @Size(max = 256, message = "字段名称长度不能超过256")
    @TableField(value = "field_name", condition = LIKE)
    @Excel(name = "字段名称")
    private String fieldName;

    /**
     * 字段英文名称
     */
    @ApiModelProperty(value = "字段英文名称")
    @Size(max = 256, message = "字段英文名称长度不能超过256")
    @TableField(value = "field_en_name", condition = LIKE)
    @Excel(name = "字段英文名称")
    private String fieldEnName;

    /**
     * 关键字
     */
    @ApiModelProperty(value = "关键字")
    @Size(max = 256, message = "关键字长度不能超过256")
    @TableField(value = "keyword", condition = LIKE)
    @Excel(name = "关键字")
    private String keyword;

    /**
     * 字段类型
     */
    @ApiModelProperty(value = "字段类型")
    @Size(max = 128, message = "字段类型长度不能超过128")
    @TableField(value = "field_type", condition = LIKE)
    @Excel(name = "字段类型")
    private String fieldType;

    /**
     * 字段类型属性
     */
    @ApiModelProperty(value = "字段类型属性")
    @Size(max = 256, message = "字段类型属性长度不能超过256")
    @TableField(value = "field_type_attribute", condition = LIKE)
    @Excel(name = "字段类型属性")
    private String fieldTypeAttribute;

    /**
     * 字段类型属性值
     */
    @ApiModelProperty(value = "字段类型属性值")
    @Size(max = 256, message = "字段类型属性值长度不能超过256")
    @TableField(value = "field_type_attribute_value", condition = LIKE)
    @Excel(name = "字段类型属性值")
    private String fieldTypeAttributeValue;

    /**
     * 标签键名
     */
    @ApiModelProperty(value = "标签键名")
    @Size(max = 128, message = "标签键名长度不能超过128")
    @TableField(value = "label_key", condition = LIKE)
    @Excel(name = "标签键名")
    private String labelKey;

    /**
     * 值键名
     */
    @ApiModelProperty(value = "值键名")
    @Size(max = 128, message = "值键名长度不能超过128")
    @TableField(value = "label_value_key", condition = LIKE)
    @Excel(name = "值键名")
    private String labelValueKey;

    /**
     * 子集键名
     */
    @ApiModelProperty(value = "子集键名")
    @Size(max = 64, message = "子集键名长度不能超过64")
    @TableField(value = "children_key", condition = LIKE)
    @Excel(name = "子集键名")
    private String childrenKey;

    /**
     * 提示语
     */
    @ApiModelProperty(value = "提示语")
    @Size(max = 256, message = "提示语长度不能超过256")
    @TableField(value = "placeholder", condition = LIKE)
    @Excel(name = "提示语")
    private String placeholder;

    /**
     * 英文提示语
     */
    @ApiModelProperty(value = "英文提示语")
    @Size(max = 256, message = "英文提示语长度不能超过256")
    @TableField(value = "en_placeholder", condition = LIKE)
    @Excel(name = "英文提示语")
    private String enPlaceholder;

    /**
     * 字段描述
     */
    @ApiModelProperty(value = "字段描述")
    @Size(max = 256, message = "字段描述长度不能超过256")
    @TableField(value = "field_desc", condition = LIKE)
    @Excel(name = "字段描述")
    private String fieldDesc;

    /**
     * 字段英文描述
     */
    @ApiModelProperty(value = "字段英文描述")
    @Size(max = 256, message = "字段英文描述长度不能超过256")
    @TableField(value = "field_en_desc", condition = LIKE)
    @Excel(name = "字段英文描述")
    private String fieldEnDesc;

    /**
     * 字数限制
     */
    @ApiModelProperty(value = "字数限制")
    @TableField(value = "input_length")
    @Excel(name = "字数限制")
    private Integer inputLength;

    /**
     * 排序
     */
    @ApiModelProperty(value = "排序")
    @TableField(value = "sequence")
    @Excel(name = "排序")
    private Integer sequence;

    /**
     * 表单分组类型 #{PERSONAL:个人;COMPANY:公司;GENNERAL:总部}
     */
    @ApiModelProperty(value = "表单分组类型 #{PERSONAL:个人;COMPANY:公司;GENNERAL:总部}")
    @TableField(value = "field_group")
    @Excel(name = "表单分组类型 #{PERSONAL:个人;COMPANY:公司;GENNERAL:总部}", replace = {"个人_PERSONAL", "公司_COMPANY", "总部_GENNERAL",  "_null"})
    private FormFieldFieldGroupEnum fieldGroup;

    /**
     * 示例图片
     */
    @ApiModelProperty(value = "示例图片")
    @Size(max = 256, message = "示例图片长度不能超过256")
    @TableField(value = "legend", condition = LIKE)
    @Excel(name = "示例图片")
    private String legend;

    /**
     * 示例图片描述
     */
    @ApiModelProperty(value = "示例图片描述")
    @Size(max = 256, message = "示例图片描述长度不能超过256")
    @TableField(value = "legend_desc", condition = LIKE)
    @Excel(name = "示例图片描述")
    private String legendDesc;

    /**
     * 示例图片英文描述
     */
    @ApiModelProperty(value = "示例图片英文描述")
    @Size(max = 256, message = "示例图片英文描述长度不能超过256")
    @TableField(value = "legend_en_desc", condition = LIKE)
    @Excel(name = "示例图片英文描述")
    private String legendEnDesc;

    /**
     * 是否可编辑：1是；0否
     */
    @ApiModelProperty(value = "是否可编辑：1是；0否")
    @TableField(value = "is_edit")
    @Excel(name = "是否可编辑：1是；0否")
    private Integer isEdit;

    /**
     * 是否必填：1是；0否
     */
    @ApiModelProperty(value = "是否必填：1是；0否")
    @TableField(value = "is_required")
    @Excel(name = "是否必填：1是；0否")
    private Integer isRequired;

    /**
     * 是否多选：1是；0否
     */
    @ApiModelProperty(value = "是否多选：1是；0否")
    @TableField(value = "is_multiple")
    @Excel(name = "是否多选：1是；0否")
    private Integer isMultiple;

    /**
     * 是否是线下预登记字段：1是；0否
     */
    @ApiModelProperty(value = "是否是线下预登记字段：1是；0否")
    @TableField(value = "is_offline")
    @Excel(name = "是否是线下预登记字段：1是；0否")
    private Integer isOffline;

    /**
     * 是否需要验证：1是；0否
     */
    @ApiModelProperty(value = "是否需要验证：1是；0否")
    @TableField(value = "is_verification")
    @Excel(name = "是否需要验证：1是；0否")
    private Integer isVerification;

    /**
     * 验证关键字
     */
    @ApiModelProperty(value = "验证关键字")
    @Size(max = 256, message = "验证关键字长度不能超过256")
    @TableField(value = "verification_keyword", condition = LIKE)
    @Excel(name = "验证关键字")
    private String verificationKeyword;

    /**
     * 是否启用：1是；0否
     */
    @ApiModelProperty(value = "是否启用：1是；0否")
    @TableField(value = "is_enabled")
    @Excel(name = "是否启用：1是；0否")
    private Integer isEnabled;

    /**
     * 是否删除：1是；0否
     */
    @ApiModelProperty(value = "是否删除：1是；0否")
    @TableField(value = "is_deleted")
    @Excel(name = "是否删除：1是；0否")
    private Integer isDeleted;

    /**
     * 是否用于完善信息：1是；0否
     */
    @ApiModelProperty(value = "是否用于完善信息：1是；0否")
    @TableField(value = "is_perfect_info")
    @Excel(name = "是否用于完善信息：1是；0否")
    private Integer isPerfectInfo;

    /**
     * 是否用于详情：1是；0否
     */
    @ApiModelProperty(value = "是否用于详情：1是；0否")
    @TableField(value = "is_details")
    @Excel(name = "是否用于详情：1是；0否")
    private Integer isDetails;

    /**
     * 前缀名称
     */
    @ApiModelProperty(value = "前缀名称")
    @Size(max = 256, message = "前缀名称长度不能超过256")
    @TableField(value = "prefix_name", condition = LIKE)
    @Excel(name = "前缀名称")
    private String prefixName;

    /**
     * 前缀关键字
     */
    @ApiModelProperty(value = "前缀关键字")
    @Size(max = 256, message = "前缀关键字长度不能超过256")
    @TableField(value = "prefix_keyword", condition = LIKE)
    @Excel(name = "前缀关键字")
    private String prefixKeyword;

    /**
     * 前缀属性
     */
    @ApiModelProperty(value = "前缀属性")
    @Size(max = 128, message = "前缀属性长度不能超过128")
    @TableField(value = "prefix_attribute", condition = LIKE)
    @Excel(name = "前缀属性")
    private String prefixAttribute;

    /**
     * 前缀属性值
     */
    @ApiModelProperty(value = "前缀属性值")
    @Size(max = 256, message = "前缀属性值长度不能超过256")
    @TableField(value = "prefix_attribute_value", condition = LIKE)
    @Excel(name = "前缀属性值")
    private String prefixAttributeValue;

    /**
     * 前缀标签键名
     */
    @ApiModelProperty(value = "前缀标签键名")
    @Size(max = 128, message = "前缀标签键名长度不能超过128")
    @TableField(value = "prefix_label_key", condition = LIKE)
    @Excel(name = "前缀标签键名")
    private String prefixLabelKey;

    /**
     * 前缀值键名
     */
    @ApiModelProperty(value = "前缀值键名")
    @Size(max = 128, message = "前缀值键名长度不能超过128")
    @TableField(value = "prefix_label_value_key", condition = LIKE)
    @Excel(name = "前缀值键名")
    private String prefixLabelValueKey;

    /**
     * 前缀子集键名
     */
    @ApiModelProperty(value = "前缀子集键名")
    @Size(max = 64, message = "前缀子集键名长度不能超过64")
    @TableField(value = "prefix_children_key", condition = LIKE)
    @Excel(name = "前缀子集键名")
    private String prefixChildrenKey;

    /**
     * 前缀开关
     */
    @ApiModelProperty(value = "前缀开关")
    @TableField(value = "is_prefix")
    @Excel(name = "前缀开关")
    private Integer isPrefix;

    /**
     * 后缀名称
     */
    @ApiModelProperty(value = "后缀名称")
    @Size(max = 256, message = "后缀名称长度不能超过256")
    @TableField(value = "suffix_name", condition = LIKE)
    @Excel(name = "后缀名称")
    private String suffixName;

    /**
     * 后缀关键字
     */
    @ApiModelProperty(value = "后缀关键字")
    @Size(max = 256, message = "后缀关键字长度不能超过256")
    @TableField(value = "suffix_keyword", condition = LIKE)
    @Excel(name = "后缀关键字")
    private String suffixKeyword;

    /**
     * 后缀属性
     */
    @ApiModelProperty(value = "后缀属性")
    @Size(max = 128, message = "后缀属性长度不能超过128")
    @TableField(value = "suffix_attribute", condition = LIKE)
    @Excel(name = "后缀属性")
    private String suffixAttribute;

    /**
     * 后缀属性值
     */
    @ApiModelProperty(value = "后缀属性值")
    @Size(max = 256, message = "后缀属性值长度不能超过256")
    @TableField(value = "suffix_attribute_value", condition = LIKE)
    @Excel(name = "后缀属性值")
    private String suffixAttributeValue;

    /**
     * 后缀标签键名
     */
    @ApiModelProperty(value = "后缀标签键名")
    @Size(max = 128, message = "后缀标签键名长度不能超过128")
    @TableField(value = "suffix_label_key", condition = LIKE)
    @Excel(name = "后缀标签键名")
    private String suffixLabelKey;

    /**
     * 后缀值键名
     */
    @ApiModelProperty(value = "后缀值键名")
    @Size(max = 128, message = "后缀值键名长度不能超过128")
    @TableField(value = "suffix_label_value_key", condition = LIKE)
    @Excel(name = "后缀值键名")
    private String suffixLabelValueKey;

    /**
     * 后缀子集键名
     */
    @ApiModelProperty(value = "后缀子集键名")
    @Size(max = 64, message = "后缀子集键名长度不能超过64")
    @TableField(value = "suffix_children_key", condition = LIKE)
    @Excel(name = "后缀子集键名")
    private String suffixChildrenKey;

    /**
     * 后缀开关
     */
    @ApiModelProperty(value = "后缀开关")
    @TableField(value = "is_suffix")
    @Excel(name = "后缀开关")
    private Integer isSuffix;


    @Builder
    public FormField(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, 
                    Long projectId, Long exhibitionId, String subjectType, String languageType, String fieldName, 
                    String fieldEnName, String keyword, String fieldType, String fieldTypeAttribute, String fieldTypeAttributeValue, String labelKey, 
                    String labelValueKey, String childrenKey, String placeholder, String enPlaceholder, String fieldDesc, String fieldEnDesc, 
                    Integer inputLength, Integer sequence, FormFieldFieldGroupEnum fieldGroup, String legend, String legendDesc, String legendEnDesc, 
                    Integer isEdit, Integer isRequired, Integer isMultiple, Integer isOffline, Integer isVerification, String verificationKeyword, 
                    Integer isEnabled, Integer isDeleted, Integer isPerfectInfo, Integer isDetails, String prefixName, String prefixKeyword, 
                    String prefixAttribute, String prefixAttributeValue, String prefixLabelKey, String prefixLabelValueKey, String prefixChildrenKey, Integer isPrefix, 
                    String suffixName, String suffixKeyword, String suffixAttribute, String suffixAttributeValue, String suffixLabelKey, String suffixLabelValueKey, 
                    String suffixChildrenKey, Integer isSuffix) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.projectId = projectId;
        this.exhibitionId = exhibitionId;
        this.subjectType = subjectType;
        this.languageType = languageType;
        this.fieldName = fieldName;
        this.fieldEnName = fieldEnName;
        this.keyword = keyword;
        this.fieldType = fieldType;
        this.fieldTypeAttribute = fieldTypeAttribute;
        this.fieldTypeAttributeValue = fieldTypeAttributeValue;
        this.labelKey = labelKey;
        this.labelValueKey = labelValueKey;
        this.childrenKey = childrenKey;
        this.placeholder = placeholder;
        this.enPlaceholder = enPlaceholder;
        this.fieldDesc = fieldDesc;
        this.fieldEnDesc = fieldEnDesc;
        this.inputLength = inputLength;
        this.sequence = sequence;
        this.fieldGroup = fieldGroup;
        this.legend = legend;
        this.legendDesc = legendDesc;
        this.legendEnDesc = legendEnDesc;
        this.isEdit = isEdit;
        this.isRequired = isRequired;
        this.isMultiple = isMultiple;
        this.isOffline = isOffline;
        this.isVerification = isVerification;
        this.verificationKeyword = verificationKeyword;
        this.isEnabled = isEnabled;
        this.isDeleted = isDeleted;
        this.isPerfectInfo = isPerfectInfo;
        this.isDetails = isDetails;
        this.prefixName = prefixName;
        this.prefixKeyword = prefixKeyword;
        this.prefixAttribute = prefixAttribute;
        this.prefixAttributeValue = prefixAttributeValue;
        this.prefixLabelKey = prefixLabelKey;
        this.prefixLabelValueKey = prefixLabelValueKey;
        this.prefixChildrenKey = prefixChildrenKey;
        this.isPrefix = isPrefix;
        this.suffixName = suffixName;
        this.suffixKeyword = suffixKeyword;
        this.suffixAttribute = suffixAttribute;
        this.suffixAttributeValue = suffixAttributeValue;
        this.suffixLabelKey = suffixLabelKey;
        this.suffixLabelValueKey = suffixLabelValueKey;
        this.suffixChildrenKey = suffixChildrenKey;
        this.isSuffix = isSuffix;
    }

}
